<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml">

    <ui:define name="title">
        MenuButton
    </ui:define>

    <ui:define name="description">
        MenuButton groups multiple items in a popup.
    </ui:define>

    <ui:param name="documentationLink" value="/components/menubutton"/>
    <ui:param name="widgetLink" value="MenuButton"/>

    <ui:define name="implementation">
        <div class="card">
            <h:form>
                <p:growl id="messages" showDetail="true"/>

                <h5 class="mt-0">Basic</h5>
                <p:menuButton value="Options">
                    <p:menuitem value="Save (Non-Ajax)" action="#{menuView.save}" ajax="false" update="messages" icon="pi pi-save"/>
                    <p:menuitem value="Update" action="#{menuView.update}" update="messages" icon="pi pi-refresh"/>
                    <p:menuitem value="Delete" action="#{menuView.delete}" update="messages" icon="pi pi-times"/>
                    <p:divider/>
                    <p:menuitem value="Website" url="http://www.primefaces.org" icon="pi pi-external-link"/>
                </p:menuButton>

                <h5>Button style</h5>
                <p:menuButton value="Options" buttonStyleClass="ui-button-outlined" buttonStyle="border-radius: 0 1rem">
                    <p:menuitem value="Save (Non-Ajax)" action="#{menuView.save}" ajax="false" update="messages" icon="pi pi-save"/>
                    <p:menuitem value="Update" action="#{menuView.update}" update="messages" icon="pi pi-refresh"/>
                    <p:menuitem value="Delete" action="#{menuView.delete}" update="messages" icon="pi pi-times"/>
                    <p:divider/>
                    <p:menuitem value="Website" url="http://www.primefaces.org" icon="pi pi-external-link"/>
                </p:menuButton>

                <h5>Ajax Disabling and Status Icon</h5>
                <p:menuButton value="Options">
                    <p:menuitem value="Save" action="#{menuView.sleepAndSave}" update="messages" icon="pi pi-save"/>
                    <p:menuitem value="Update" action="#{menuView.sleepAndUpdate}" update="messages" icon="pi pi-refresh"/>
                    <p:menuitem value="Delete" action="#{menuView.sleepAndDelete}" update="messages" icon="pi pi-times"/>
                </p:menuButton>
            </h:form>
        </div>
    </ui:define>

</ui:composition>
